﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using DataAnnotationsExtensions;
using MvcEnumDropDownList.Helpers;

namespace BenzInfo.Hockey.LHRAF.Models
{
    [Table("Players")]
    public class Player : Person
    {
        [LocalizationEnum(typeof(Resources.Models.Player))]    
        public enum PositionEnum : byte
        {
            Center = 1,
            LeftWing,
            RightWing,
            Defenseman,
            Goalie
        }

        public virtual Team Team { get; set; }

        [Required]
        [EnumDataType(typeof(PositionEnum))]
        public int PositionValue { get; set; }
        
        [Display(Name = "DisplayPosition", ResourceType = typeof(Resources.Models.Player))]
        public PositionEnum PositionPlayed
        {
            get { return (PositionEnum)PositionValue;}
            set { PositionValue = (int)value; }
        }

        [Required]
        [Integer, Range(1, 99)]
        [Display(Name = "DisplayNumber", ResourceType = typeof(Resources.Models.Player))]
        public int Number { get; set; }
    }
}